package com.gnerv.pabu.basic.core.exception;

import org.springframework.util.StringUtils;

/**
 * <p>
 * 业务异常
 * </p>
 *
 * @author Gnerv LiGen
 * @since 2019-10-10
 */
public class BusinessException extends RuntimeException {

    public static final String MENU_HAS_CHILDREN = "存在下级菜单，请先删除下级菜单！";
    public static final String MENU_SYSTEM = "顶级类型必须为系统！";
    public static final String MENU_SYSTEM_CHILDREN = "系统下只能创建目录或者菜单";
    public static final String MENU_CATALOG_CHILDREN = "目录下只能创建菜单";
    public static final String MENU_MENU_CHILDREN = "菜单下只能创建按钮";
    public static final String MENU_DIR = "目录下只可以目录或者菜单别的下级菜单！";
    public static final String MENU_MENU = "菜单下只可以添加按钮级别的下级菜单！";
    public static final String ORG_HAS_CHILDREN = "存在下级机构，请先删除下级机构！";
    public static final String KAPTCHA_NO = "验证码不能为空！";

    public BusinessException() {
        super("参数异常");
    }

    public BusinessException(String message) {
        super(StringUtils.isEmpty(message) ? "参数异常" : message);
    }

}
